<php> $cMod = strtoupper($mod);</php>
<div class="comments" data-del-url="{:tox_addons_url('LocalComment/Index/deleteComment', array('count_model'=>$count_model,'count_field'=>$count_field))}">
   	<div class="reply-form clearfix">
		<php>if($can_guest || is_login()){</php>
            <textarea class="new-comment-text" id="local_comment_textarea" placeholder=""></textarea>
		<php>}else{</php>
		<div class="ts">
			您需要登录后才能评论      <a href="{:U('Ucenter/Member/login')}">登录</a> <span>|</span> <a href="{:U('Ucenter/Member/register')}">立刻注册</a>			
		</div>
		<php>}</php>
		<div class="replybtn">
			<a href="javascript:" data-role="send_local_comment" data-path="{$path}" data-this-url="{$this_url}" data-extra="{$extra}" data-url="{:tox_addons_url('LocalComment/Index/addComment', array('uid'=>$uid,'count_model'=>$count_model,'count_field'=>$count_field))}" >发表评论</a>
		</div>	
	</div>
    

    <div class="comments-nav">
		<ul>
			<li><a href="#">最新评论</a></li>
		</ul>
		<h4>共 {$total_count}人评论</h4>
	</div>
    <section class="comments-list clearfix">
        <empty name="list"><div id="empty" class="text-muted text-center" ><i class="icon-inbox"></i> 暂无评论</div></empty>
        <volist name="list" id="comment">
            <include file="./Addons/LocalComment/_comment.html"/>
        </volist>
        <div class="pager">
            {$pageHtml}
        </div>
    </section>
</div>

<script>
    var local_comment_order = "{:modC($cMod.'_LOCAL_COMMENT_ORDER',0)}";
    var local_comment_count = "{:modC($cMod.'_LOCAL_COMMENT_COUNT',10)}";
    var local_comment_page = function (app, mod, row_id, page) {
        $.post("{:tox_addons_url('LocalComment/Index/getCommentList')}", {
            app: app,
            mod: mod,
            row_id: row_id,
            page: page
        }, function (res) {
            $('.comments').find('section').html(res.html);
            bind_local_comment();
        }, 'json');
    }


    $(function () {
        $('#local_comment_textarea').keypress(function (e) {
            if (e.ctrlKey && e.which == 13 || e.which == 10) {
                $(this).closest('.form').find("[data-role='send_local_comment']").click();
            }
        });
    })


</script>
<link href="{:getRootUrl()}Addons/LocalComment/_static/css/comment.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="{:getRootUrl()}Addons/LocalComment/_static/js/comment.js"></script>
